package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AspectController {

    private static final Logger LOG = LoggerFactory.getLogger(AspectController.class);

    @RequestMapping("/testAsperctNoParameter")
    public String testAsperct() {
        LOG.info("我在controller层,没有参数");
        return "success";
    }

    @RequestMapping("/testAsperctOneParameter")
    public String testAsperct(String parameter) {
        LOG.info("我在controller层,一个参数:{}", parameter);
        int i = 1 / 0;
        return "success";
    }

    @RequestMapping("/testAsperctTwoParameter")
    public String testAsperct(String parameter1, String parameter2) {
        LOG.info("我在controller层，两个参数:{},{}", parameter1, parameter2);
        return "success";
    }


    @RequestMapping("/testAsperctAround")
    public String testAsperctAround(String parameter) {
        LOG.info("我在controller层，参数:{}", parameter);
        return "success";
    }

}
